/**
 *    Copyright 2009 Seth Albnaese
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/** $Id: AquiferServerRunner.java 38 2009-05-12 11:39:24Z salbanese0080@gmail.com $ */

package org.aquiferserver.server;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Seth Albanese
 * 
 */
public class AquiferServerRunner {

	public static final Log logger = LogFactory.getLog( org.aquiferserver.server.AquiferServerRunner.class );
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( new String[] { "aquifer-application-context.xml" } );
		
		AquiferServer server = ( AquiferServer ) context.getBean( "AquiferServer" );
		
		Runtime.getRuntime().addShutdownHook( new Thread() {
			public void run() { 
				logger.info( "Server shutting down..." );
			}
		});	 
		
		server.start( 23230 );
		
	}

}
